GOOGLE_PRISM_SITE=repo://vendor/google/prism
GOOGLE_PRISM_INSTALL_STAGING=YES
GOOGLE_PRISM_INSTALL_TARGET=YES
GOOGLE_PRISM_DEPENDENCIES=\
	host-py-mox \
	python \
	python-setuptools \
	google_platform \
	host-googletest \

GOOGLE_PRISM_MAKE_OPTS = PON_TYPE=$(BR2_PACKAGE_MV_APP_PON_TYPE)

GPRISM_MAKE = \
	HOSTDIR=$(HOST_DIR) \
	DESTDIR=$(TARGET_DIR) \
	HOSTPYTHONPATH=$(HOST_PYTHONPATH) \
	TARGETPYTHONPATH=$(TARGET_PYTHONPATH) \
	PYTHON=$(HOST_DIR)/usr/bin/python \
	CROSS_COMPILE=$(TARGET_CROSS) \
	BRUNO_PROD_BUILD=$(BR2_PACKAGE_GOOGLE_PROD) \
	CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
	PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
	PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
	PKG_CONFIG_PATH="$(@D)/base:$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \
	BRUNO_ARCH=$(GOOGLE_PLATFORM_ARCH) \
	$(MAKE)

define GOOGLE_PRISM_BUILD_CMDS
	$(GPRISM_MAKE) -C $(@D) $(GOOGLE_PRISM_MAKE_OPTS)
endef

define GOOGLE_PRISM_TEST_CMDS
	PYTHONPATH=$(HOST_PYTHONPATH):$(TARGET_DIR)/usr/catawampus \
	PYTHON=$(HOST_DIR)/usr/bin/python $(MAKE) -C $(@D) $(GOOGLE_PRISM_MAKE_OPTS) test
endef

define GOOGLE_PRISM_INSTALL_STAGING_CMDS
	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(@D) $(GOOGLE_PRISM_MAKE_OPTS) install-libs
endef

define GOOGLE_PRISM_INSTALL_TARGET_CMDS
	$(GPRISM_MAKE) -C $(@D) $(GOOGLE_PRISM_MAKE_OPTS) install
endef

$(eval $(call GENTARGETS))
